package framework.movements;

import org.newdawn.slick.geom.Point;

import framework.BasicFighter;

public class LinearMovement extends Movement {
	
	private Point startPoint;
	
	private Point endPoint;

	public LinearMovement() {
		this(new Point(0, 0), new Point(0, 0));
	}
	
	public LinearMovement(Point startPoint, Point endPoint) {
		this(startPoint, endPoint, 100);
	}
	
    public LinearMovement(BasicFighter f, Point endPoint) {
		this(new Point(f.getX(), f.getY()), endPoint, 100);
	}
    
    public LinearMovement(BasicFighter f, int translateX, int translateY) {
		this(new Point(f.getX(), f.getY()), new Point(f.getX() + translateX, f.getY() + translateY), 100);
	}
	
	public LinearMovement(Point startPoint, Point endPoint, int duration) {
		this.startPoint = startPoint;
		this.endPoint = endPoint;
		setDuration(duration);
		setMode(new LinearStrategy(this));
		setStayTimeEnd(0);
	}
	
	public void trigger() {
		currentTime = 1;
		setX((int) startPoint.getX());
		setY((int) startPoint.getY());
	}
	
	public Point getStartPoint() {
		return startPoint;
	}

	public Point getEndPoint() {
		return endPoint;
	}

	public void setStartPoint(Point startPoint) {
		this.startPoint = startPoint;
	}

	public void setEndPoint(Point endPoint) {
		this.endPoint = endPoint;
	}
}
